/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package control;

import model.Turma;
import model.dao.TurmaDAO;

/**
 *
 * @author Patrick
 */
class TurmaControl {
    
    public boolean cadastraTurma(String horario){
        Turma turma = new Turma();
        turma.setHorario(horario);
        
        TurmaDAO dao = new TurmaDAO();
        dao.beginTransaction();
        dao.save(turma);
        dao.stopOperation(true);
        return true;
    }

    public Turma pesquisarPorHorario(String turmaTurno) {
        TurmaDAO dao = new TurmaDAO();
        dao.beginTransaction();
        Turma turma = dao.pesquisaPorHorario(turmaTurno);
        dao.stopOperation(false);
        return turma;
    }
    
}
